﻿#region Header

/*
Remote views based on linq
By

Pascal Hauser 
Dipl. Ing. in Informatik, Hochschule für Technik Rapperswil, 2006
Master Thesis, Hochschule für Technik Rapperswil, 2008-2010

and

Raphael Gfeller
Dipl. Ing. in Informatik, Hochschule für Technik Rapperswil, 2006
Master Thesis, Hochschule für Technik Rapperswil, 2008-2010

*/

#endregion

#region Usings

using System.Collections.Generic;
using Sebarf.Core.Interfaces;

#endregion

namespace Sebarf.Core.Internal {
	/// <summary>
	/// Description of the class
	/// </summary>
	internal class AddRequestHandlerService : IAddRequestHandlerService {
		#region Public Properties

		public RequestHandlerEngine RequestHandlerEngine { get; set; }

		#endregion

		#region Public Methods

		public AddRequestHandlerService(RequestHandlerEngine engine) {
			RequestHandlerEngine = engine;
		}

		#endregion

		#region IAddRequestHandlerService Members

		public void AddAddionalHandler(IRequestHandler handler) {
			var handlers = new List<IRequestHandler>(RequestHandlerEngine.ApplicationHandlers);
			handlers.Add(handler);
			RequestHandlerEngine.SetHandler(handlers.ToArray());
		}

		#endregion
	}
}